package com.leileimann.tour.mapper;

import com.leileimann.tour.entity.SSpot;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author leileiMann
 * @date 2022/3/9 15:28
 */
@Mapper
@Repository
public interface SSpotMapper {

    /**查找所有的景点*/
    List<SSpot> getAllSSpot(@Param("pagenum")int pagenum);

    /**获取景区数量*/
    int getSSpotNum();

    /**通过城市名查找景点*/
    List<SSpot> getSSpotByCityName(@Param("cityname")String cityname,@Param("pageNum")int pageNum);

    /**通过景点名查找该景点详情，返回一个景区实体*/
    SSpot getSSpotDeatil(@Param("sspotname")String sspotname);

    /**根据城市名称获取该城市景点数量*/
    int getSSpotNumByCityName(@Param("cityname")String cityname);
    /**通过收藏的景点名称获取景点，收藏页面使用*/
    SSpot getSSpotByCollectname(@Param("collectname")String collectname);

    /**通过景区名模糊查询景区*/
    List<SSpot> findSSpotByMH(@Param("sspotname")String sspotname);

    /**模糊查询实体的总数*/
    int findNumOfSSpot(@Param("sspotname")String sspotname,@Param("cityname")String cityname);
}
